
<div class="main fly-user-main layui-clear">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
        <li class="layui-nav-item"><a href="{:U('home/u/index',array('id'=>$_SESSION['id']))}"> <i class="layui-icon"></i> 我的主页 </a></li>
        <li class="layui-nav-item "><a href="{:U('home/users/index')}"> <i class="layui-icon"></i> 用户中心 </a></li>
        <li class="layui-nav-item "><a href="{:U('home/set/index')}"> <i class="layui-icon"></i> 基本设置
        </a></li>
        <li class="layui-nav-item layui-this"><a href="{:U('home/msg/index')}"> <i class="layui-icon"></i> 我的消息 </a>
        </li>
        <!-- <li class="layui-nav-item "><a href="{:U('home/vip/index')}"> <i class="layui-icon"></i> 会员授权 </a></li> -->
        <span class="layui-nav-bar" style="top: 77.5px; height: 0px; opacity: 0;"></span></ul>
    <div class="site-tree-mobile layui-hide"><i class="layui-icon"></i></div>
    <div class="site-mobile-shade"></div>
    <div class="fly-panel fly-panel-user" pad20="">
        <div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_msg" style="margin-top: 15px;">
            <button class="layui-btn layui-btn-danger" id="LAY_delallmsg">清空全部消息</button>
            <div id="LAY_minemsg" style="margin-top: 10px;">
                <ul class="mine-msg">
                    <?php foreach ($mymsg as $value) { ?>
                        <li data-id="<?php echo $value['id'] ?>">
                        <blockquote class="layui-elem-quote">
                            <a href="{:U('home/u/index',array('id'=>$value['uid']))}" target="_blank">
                                <cite><?php echo $value['nickname'] ?></cite>
                            </a>
                            <?php if ($value['status']==1) { ?>
                                回答了你的提问
                            <?php } ?>
                            <?php if ($value['status']==2) { ?>
                                在
                            <?php } ?>
                            <?php if ($value['status']==3) { ?>
                                在
                            <?php } ?>
                            <?php if ($value['status']==4) { ?>
                                收藏了的问题
                            <?php } ?>
                            <?php if ($value['status']==5) { ?>
                                采纳了你在
                            <?php } ?>
                            <a target="_blank" href="{:U('home/contg/index',array('id'=>$value['qid']))}">
                                <cite><?php echo $value['title'] ?></cite>
                            </a>
                            <?php if ($value['status']==2) { ?>
                                的问题中 @ 你的回复
                            <?php } ?>
                            <?php if ($value['status']==3) { ?>
                                的问题中 赞了你的回复
                            <?php } ?>
                            <?php if ($value['status']==5) { ?>
                                回答
                            <?php } ?>
                        </blockquote>
                        <p>
                            <span><?php echo CTS($value['create_time']) ?></span>
                            <a href="javascript:;" msgid="<?php echo $value['id'] ?>" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a>
                        </p>
                    </li>
                    <?php } ?>
                </ul>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['form','jquery','layedit'], function(){
        var form = layui.form(),
            layer = layui.layer,
            $= layui.jquery;

            $('.fly-delete').click(function() {
               data=$(this).attr('msgid');
               $.ajax({
                   url: '{:U('home/msg/delmsg')}',
                   type: 'POST',
                   dataType: 'json',
                   data: {data: data},
               })
               .done(function(respones) {
             if (respones.error==1) {
                layer.msg(respones.info);
             }else{
                    layer.msg(respones.info,function  () {
                    location.reload()
                        });

                }
            })
               .fail(function(respones) {
                   layer.msg(respones.info);
               })

               
            });
        });
</script>